package com.example.starterdemotest;

import com.example.starterdemo.AliyunSmsSenderImpl;
import com.example.starterdemo.SmsSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class TestController {

    @Autowired
    @Qualifier("aliYunSmsSender")
    private SmsSender aliYunSmsSender;

    @Autowired
    @Qualifier("tencentSmsSender")
    private SmsSender tencentSmsSender;

    @GetMapping("test")
    public void test(){
        aliYunSmsSender.send("用阿里云发送短信");
        tencentSmsSender.send("用腾讯云发送短信");
    }
}
